#pragma strict
var ball:GameObject;
var laughh:AudioClip;
public var i:textscript;
var time:int=0;
var flag=true;
function Start () {

}

function Update () {
if(!flag)
ball.rigidbody.constraints=RigidbodyConstraints.FreezePositionX|RigidbodyConstraints.FreezePositionY|RigidbodyConstraints.FreezePositionZ;
transform.Rotate(100*Time.deltaTime,0,0);
}

function OnCollisionEnter(other:Collision)
{
flag=false;
for(var k=0;k<4;k++)
{
time++;
}
if(time>3)
{
flag=true;
}

ball.rigidbody.AddRelativeForce(1100,5000,0);
audio.PlayClipAtPoint(laughh,transform.position);
transform.renderer.material.color=Color.red;
i.SubScore();








}